package com.comtop.topcloud.device.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.comtop.topcloud.device.model.mysql.EnergyMonitorAlarm;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface EnergyMonitorAlarmMapper extends BaseMapper<EnergyMonitorAlarm> {

    @Insert({
            "<script>",
            "INSERT INTO `energy_monitor_alarm` (alarm_name, alarm_level, alarm_time, alarm_status, terminal_fields, equipment_type, org_id, value, alarm_describe, equipment_id, id, belang_users, immunity_endtime, alarm_type, tag_name, tag_name_alias_name) VALUES ",
            "<foreach collection='list' item='item' separator=','>",
            "(#{item.alarmName}, #{item.alarmLevel}, #{item.alarmTime}, #{item.alarmStatus}, #{item.terminalFields}, #{item.equipmentType}, #{item.orgId}, #{item.value}, #{item.alarmDescribe}, #{item.equipmentId}, #{item.id}, #{item.belangUsers}, #{item.immunityEndtime}, #{item.alarmType}, #{item.tagName}, #{item.tagNameAliasName})",
            "</foreach>",
            "</script>"
    })
    int batchInsert(@Param("list") List<EnergyMonitorAlarm> energyMonitorAlarmList);


}
